#ifndef CARMODEL_H_
#define CARMODEL_H_

#include "geometry.h"

class CarModel
{
	
protected:
	float _speed;		//Vitesse (en m/s)
	float _orientation;	//Orientation de la voiture par rapport à l'axe normal (en degrés)
	Coord _coord;		//Les coordonnées du centre de la voiture
	float _adherence;	//Le coefficient d'adhérence de la voiture
	float _weight;		//Le poids de la voiture (en newtons)
	float _condition;	//L'état de la voiture
	
public:

	static const float CONDITION_MAX = 100.0;

	CarModel(
		_speed = 0;
		_orientation = 0;
		
		condition = CONDITION_MAX;
	);
	
	virtual ~CarModel();
	
	float speed(){
		return _speed;
	}
	
	float orientation(){
		return _orientation;
	}
	
	const Coord& coord(){
		return _coord;
	}
	
	float adherence(){
		return _adherence;
	}
	
	float weight(){
		return _weight;
	}
	
	float condition(){
		return _condition;	
	}
	
	
	void setCoord(double x, double y, double z=0){
		_coord.x = x;
		_coord.y = y;
		if (z != 0)
			_coord.z = z;
	}
	
	void setCoord(const Coord& coord){
		_coord.x = coord.x;
		_coord.y = coord.y;
		if (z != 0)
			_coord.z = coord.z;
	}
	
	void setAdherence(float adherence){
		_adherence = adherence;
	}
	
	void setWeight(float weight){
		_adweight = weight;
	}
	
	void setSpeed(float speed){
		_speed = speed;
	}
	
	void setOrientation(float orientation){
		_orientation = orientation;
	}
	
	void setCondition(float condition){
		_condition = condition;
	}
	
	
	
	virtual void turn(float angle) = 0;
	
	virtual void brake(float intensity) = 0;
	
	virtual void accelerate(float intensity) = 0;
		
};

#endif /*CARMODEL_H_*/
